<%@ page language="java" import="java.util.*" import="java.sql.*"
	import="com.lsnu.wzy.po.*" import="javax.servlet.http.HttpSession"
	contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!DOCTYPE html>
<html>
<body>
<head>
<meta charset="utf-8">
<title>医院网站</title>
<link rel="stylesheet"
	href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
<link href="https://cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

<script src="/Hospital/jsp/js/moment-with-locales.js"></script>
<script src="/Hospital/jsp/js/moment.js"></script>
<script src="https://cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
	
		/* $("#b01").click(function() {
			htmlobj = $.ajax({
				url : "/Hospital/jsp/test",
				async : false
			});
			$("#myDiv").html(decodeURI(htmlobj.responseText));
		}); */
	});
	function addAppoint(dID) {
		$('#myModal').modal();//显示弹出框
		$("#dataId").val(dID);//额外添加的参数
	}
	

	
	$(function () {
	    $('#datetimepicker2').datetimepicker({//datetimepicker是一个日期时间控件
	        format: 'YYYY-MM-DD',//年月日格式
	        locale: moment.locale('zh-cn')//设定moment区域为中国
	    });
	    $("#btn_submit").click(function (){
	    	window.location.href="/Hospital/appointOption/addListen2/"+$("#dataId").val()+"/"+$("#dataTime").val();
	    })
	});
	
</script>
<style>
.fakeimg {
	height: 200px;
	background: #aaa;
}
</style>
</head>
<body>
	<div class="jumbotron text-center" style="margin-bottom: 0;padding-top:0;padding-bottom:0">
		<%-- <h1 style='font-family: 仿宋'><%=((Patient) request.getSession().getAttribute("patient")).getpName()%>,欢迎您的到来！
		</h1>
		<p>感谢您对本医院的信任！</p> --%>
		<img alt="" src="/Hospital/jsp/img/f1.jpeg" width="100%" height="280px;">
	</div>

	<nav class="navbar navbar-inverse">
		<div class="container-fluid">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle" data-toggle="collapse"
					data-target="#myNavbar">
					<span class="icon-bar"></span> <span class="icon-bar"></span> <span
						class="icon-bar"></span>
				</button>
				<a class="navbar-brand" href="#">医院网站</a>
			</div>
			<div class="collapse navbar-collapse" id="myNavbar">
				<ul class="nav navbar-nav">
					<li class="active"><a href="/Hospital/jsp/index.jsp">主页</a></li>
					<li><a href="/Hospital/jsp/introduce.jsp">医院介绍</a></li>
					<li><a href="/Hospital/jsp/patientLogin.jsp">切换用户</a></li>
					<li><a href="/Hospital/html/login.html">管理员登录</a></li>
					<li style="margin-left:700px; font-size:40px; font-family:宋体">
						<a href="">当前就诊人：<%=((Patient) request.getSession().getAttribute("patient")).getpName()%></a>
					</li>
				</ul>
			</div>
		</div>
	</nav>

	<div class="container">
		<div class="row">
			<div class="col-sm-2">
				<h3 class="nav nav-pills nav-stacked active">功能列表</h3>
				<ul class="nav nav-pills nav-stacked" style="margin-top:20px">
					<li class="active"><a href="/Hospital/doctorOption/lsDoctor2">医生信息</a></li>
					<li><a href="/Hospital/departmentOption/lsDepartment2">科室信息</a></li>
					<li><a href="/Hospital/appointOption/findByPname">个人预约信息</a></li>
					<li><a href="#">敬请期待</a></li>
				</ul>
				<div class="fakeimg" style=" font-family:宋体 ;margin-top:100px">
	    			<div id="myDiv">
	    				<h4><b><br>医院联系方式：</b></h4>
	    				<h4>联系电话：0931-1234567 </h4>
	    				<h4>QQ: 1226539386</h4>
	    			</div>
        			<!-- <button id="b01" type="button" class="btn btn-primary btn-lg">查看</button> -->
    			</div>
				<hr class="hidden-sm hidden-md hidden-lg">
			</div>
			<div class="col-sm-10">
				<h2>医生信息：</h2>
				<div >
					<div  id="left" style="width:400px;float:left;">
						<form action="/Hospital/doctorOption/findByName/{dName}">
							<input type="text" name="dName" value="${dName}"> 
							<input type="submit" value="按照姓名搜索" placeholder="请输入医生姓名">
						</form>
					</div>
					<div  id="right" style="width:300px;float:left;">
						<form action="/Hospital/doctorOption//findByDep/{department}">
							<input type="text" name="department" value="${department}"> 
							<input type="submit" value="按照科室搜索" placeholder="请输入科室名">
						</form>
					</div>
				</div>
				<table class="table table-striped" id="tab">
					<thead>
						<tr>
							<th></th>
							<th class="sorting_asc">医生id</th>
							<th class="sorting">医生姓名</th>
							<th class="sorting">医生性别</th>
							<th class="sorting">医生年龄</th>
							<th class="sorting">挂号科室</th>
							<th class="sorting">医生电话</th>
						</tr>
					</thead>

					<c:forEach items="${doctor}" var="doctorlist">
						<tr>
							<td><input name="ids" type="checkbox"></td>
							<td>${doctorlist.dID}</td>
							<td>${doctorlist.dName}</td>
							<td>${doctorlist.dSex}</td>
							<td>${doctorlist.dAge}</td>
							<td>${doctorlist.department}</td>
							<td>${doctorlist.dTel}</td>
							<td>
								<%-- <a class="navbar-brand" href="/Hospital/appointOption/addListen2/${doctorlist.dID}">预约</a> --%>

								<a class="navbar-brand" href="javascript:;"
								onclick="addAppoint('${doctorlist.dID}')">预约</a>

							</td>
						</tr>
					</c:forEach>
				</table>
			</div>
		</div>
	</div>
	<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="myModalLabel">请选择预约时间</h4>
				</div>
				<div class="modal-body">

					<div class="row">
						<div class='col-sm-6'>
							<div class="form-group">
								<label>预约日期：</label>
								<div class='input-group date' id='datetimepicker2'>
									<input type='text' class="form-control" id="dataTime" /> <span
										class="input-group-addon"> <span
										class="glyphicon glyphicon-calendar"></span>
									</span>
								</div>
								<input style="display: none;" id="dataId" name="dataId" value=""/>
							</div>

						</div>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">
						<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>关闭
					</button>
					<button type="button" id="btn_submit" class="btn btn-primary"
						data-dismiss="modal">
						<span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span>保存
					</button>
				</div>
			</div>
		</div>
	</div>


	<div class="jumbotron text-center" style="margin-bottom: 0">
		<p>@版权所有 2022-人工智能学院</p>
		<p>乐山师范学院</p>
	</div>
</body>
</html>